<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
  <script>
      console.log('abcde'.lastIndexOf(']'))
      let str = 'data.object.info.age';
      let lastIndex =str.lastIndexOf('.')
      console.log(str.slice(0, lastIndex))
  </script>
</body>
</html>